#ifndef CANVAS_H
#define CANVAS_H
#include "icanvas.h"
#include "icanvas_impl.h"
#include "shapes.h"

class Canvas : public ICanvas {
private:
	ICanvasImpl* mCanvasImpl;
public:
	Canvas(ICanvasImpl* impl) : mCanvasImpl(impl) { }
	~Canvas() { }

	//use physics axel
	void init() {
		mCanvasImpl->init();
	}

	void init(double h, double w) {
		mCanvasImpl->init(h, w);
	}

	void drawDot(Point* p, int style='*') {
		mCanvasImpl->drawDot(p, style);
	}

	void drawLine(Point* start, Point* end, int style='*') {
		mCanvasImpl->drawLine(start, end, style);
	}

	void drawLine(Line* l, int style='*') {
		mCanvasImpl->drawLine(l->start(), l->end(), style);
	}

	void drawRectangle(Point* start, Point* end, int style=0) {
		mCanvasImpl->drawRectangle(start, end, style);
	}

	void clean() {
		mCanvasImpl->clean();
	}
};
#endif
